<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>functional paradigm...</title>
    <style>
      ul {
        border: 1px solid blue;
        width: 400px;
        height: 400px;
        left: 50%;
        top: 200px;
        transform: translate3d(-50%, -50%, 0);
        position: relative;
        overflow: hidden;
      }
      li {
        list-style: none;
        position: absolute;
        top: 100px;
        right: 0;
        transition: all 1s;
        transform-origin: 100% 100%;
      }
      img {
        width: 100%;
        height: 100%;
        position: absolute;
      }
    </style>
  </head>
  <body>
    <ul>
      <li>
        <img src="../src/assets/images/1.jpg" alt="" />
      </li>
      <li>
        <img src="../src/assets/images/2.jpg" alt="" />
      </li>
      <li>
        <img src="../src/assets/images/3.jpg" alt="" />
      </li>
      <li>
        <img src="../src/assets/images/4.jpg" alt="" />
      </li>
      <li>
        <img src="../src/assets/images/5.jpg" alt="" />
      </li>
      <li>
        <img src="../src/assets/images/6.jpg" alt="" />
      </li>
    </ul>
    <button id="but">button</button>
    <script>
      const li = document.getElementsByTagName('li');
      const img = document.getElementsByTagName('img');

      Array.from(li).forEach((v, i) => {
        v.style.cssText = `right: ${i * 20-60}px; width: ${100+50*i}px; height: ${100+i*50}px; top: ${100-i*20}px`;
      });

      but.onclick = function() {
        Array.from(li).forEach((v, i) => {
          
          if(i < 5) {
            v.style.cssText = `right: ${(i+1) * 20-60}px; width: ${100+50*(i+1)}px; height: ${100+(i+1)*50}px; top: ${100-(i+1)*20}px`;
          } else {
            v.style.transform = 'rotateZ(-90deg)'
            v.style.opacity = 0;
          }
        });
      }

    </script>
  </body>
</html>
